<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>批量退宿</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">

		<link rel="stylesheet"
			href="<%=request.getContextPath()%>/css/common.css" type="text/css" />

		<link rel="stylesheet"
			href="<%=request.getContextPath()%>/css/style.css" type="text/css" />
			<style type="text/css">
.tb{width:666px;border-collapse:collapse;border:1px solid #EEE;font-size:14px;} 
.tb th{background:#EEE;border-bottom:1px solid #CCC;padding:4px;} 
.tb td{border:1px solid #EEE;padding:4px;} 

.tb tr:hover{background-color:#DEF} 

body{behavior:url(hover.htc);}
</style>

		<script type='text/javascript'
			src='<%=request.getContextPath()%>/js/forCSS.js'></script>

		<script type='text/javascript'
			src='<%=request.getContextPath()%>/js/sorttable.js'></script>

		<script type='text/javascript'
			src='<%=request.getContextPath()%>/dwr/interface/dWRCollegeMajorAction.js'></script>
		<script type='text/javascript'
			src='<%=request.getContextPath()%>/dwr/interface/dormitoryAllocateAction.js'></script>
		<script type='text/javascript'
			src='<%=request.getContextPath()%>/dwr/interface/studentAction.js'></script>
		<script type='text/javascript'
			src='<%=request.getContextPath()%>/dwr/interface/studentLodgeMgrAction.js'></script>
		<script type='text/javascript'
			src='<%=request.getContextPath()%>/dwr/engine.js'></script>
		<script type='text/javascript'
			src='<%=request.getContextPath()%>/dwr/util.js'></script>
		<script type='text/javascript'
			src='<%=request.getContextPath()%>/js/jquery-latest.pack.js'></script>
		<script type='text/javascript'
			src='<%=request.getContextPath()%>/js/noConflictOfJquery.js'></script>
		<script type='text/javascript'
			src='<%=request.getContextPath()%>/js/forCSS.js'></script>
			
		<script type="text/javascript">
		var max=0;   //查询条件表的行数
		var page;   //dwr分页的page对象，注意在页面中是一个Json对象
		var stuCache = { }; 
		var s_sql =""; //查询的sql语句
		var totalCount = -1; //查询到的总行数

		
		function addlines()
	{
			CreateLine(++max);
	}
	function   deleteOneLine(obj)  
 	{  
 		 $("tr"+$("delline"+obj).id.substr(7)).style.display = "none";
 		 //alert( $("tr"+$("delline"+obj).id.substr(7)).style.display)
 		 
 	}   
 	function whenSub()
 	{
 		var sql = "select * from student where";
 		for(var n=0;n<=max;n++)
 		{
 			if($("tr"+n).style.display != "none")
 			{
 				//alert($("tr"+n).style.display);
 				
	 			if($("flag"+n).options[$('flag'+n).selectedIndex].value == "or")
	 			{   
	 				if(n == 0)
	 					sql +=" 1 = 0 or ( 1=0 ";
	 				else sql +=" or ( 1=0 ";
	 				if($("college"+n).options[$('college'+n).selectedIndex].text != "请选择学院")
	 					sql +=" or student.collegeinfoid="+$("college"+n).options[$('college'+n).selectedIndex].value;
	 				if($("major"+n).options[$('major'+n).selectedIndex].text != "请选择专业"){
	 					if($("majorflag"+n).options[$('majorflag'+n).selectedIndex].value == "and"){
	 						sql +=" and student.majorinfoid="+$("major"+n).options

[$('major'+n).selectedIndex].value;
	 					}else{
	 						sql +=" and student.majorinfoid !="+$("major"+n).options

[$('major'+n).selectedIndex].value;
	 					}
	 					
	 				}
	 				if($("college"+n).options[$('college'+n).selectedIndex].text == "请选择学院")
	 					sql += "or 1=1 ";
	 				if($("grade"+n).options[$('grade'+n).selectedIndex].text != "请选择年级"){
	 					if($("gradeflag"+n).options[$('gradeflag'+n).selectedIndex].value == "and"){
	 						sql +=" and studentenrollyear='"+$("grade"+n).options

[$('grade'+n).selectedIndex].value + "'";
	 					}else if($("gradeflag"+n).options[$('gradeflag'+n).selectedIndex].value == "bigger"){
	 						sql +=" and studentenrollyear > '"+$("grade"+n).options

[$('grade'+n).selectedIndex].value + "'";
	 					}else if($("gradeflag"+n).options[$('gradeflag'+n).selectedIndex].value == "smaller"){
	 						sql +=" and studentenrollyear < '"+$("grade"+n).options

[$('grade'+n).selectedIndex].value + "'";
	 					}else{
	 						sql +=" and studentenrollyear !='"+$("grade"+n).options

[$('grade'+n).selectedIndex].value + "'";
	 					}
	 				}
	 				if($("gender"+n).options[$('gender'+n).selectedIndex].text != "请选择性别" ){
	 					sql +=" and studentgender='"+$("gender"+n).options[$('gender'+n).selectedIndex].value + 

"'";
	 				}
	 				//如果学院，专业，年级，性别均未选，则什么也查不到
	 				if($("college"+n).options[$('college'+n).selectedIndex].text == "请选择学院" && $("grade"+n).options[$('grade'+n).selectedIndex].text == "请选择年级" &&$("gender"+n).options[$('gender'+n).selectedIndex].text == "请选择性别")
	 					sql += " and 1=0 )";
	 				else{
	 					sql +=" )";
	 				}
	 			}
	 		}
 		}
 		//alert(sql);
 		return sql;
 	}
		
		function CreateLine(n)
	{
	
		myrow=$("searchTable").insertRow(n);	
		myrow.id= "tr"+n;
		
		c=myrow.insertCell(0);

		c.innerHTML="<select name='flag"+n+"' id='flag"+n+"' class='common_select' ><option value='or' selected='selected'>和</option></select>";
		
		
		c=myrow.insertCell(1);
		c.innerHTML="<select name=\"college"+n+"\" id=\"college"+n+"\" onchange=\"selectedCollegeChange(this)\" style='width:160px' class='common_select'>"+$("college0").innerHTML+" </select>";
		
	
		c=myrow.insertCell(2);
		c.innerHTML="<select name='majorflag"+n+"' id='majorflag"+n+"'  style='width: 38px' class='common_select'>"+$("majorflag0").innerHTML+"</select><select name=\"major"+n+"\" id=\"major"+n+"\" onchange=\"selectedMajorChange(this)\" style='width:148px' class='common_select'>"
		+$("major").innerHTML+"</select>";	
		
		c=myrow.insertCell(3);
		c.innerHTML="<select name='gradeflag"+n+"' id='gradeflag"+n+"' style='width: 50px' class='common_select'>"+$("gradeflag0").innerHTML+" </select><select name='grade"+n+"' id='grade"+n+"' style='width:90px' class='common_select'>"+$("grade0").innerHTML+"</select>";	
		
		c=myrow.insertCell(4);
		c.innerHTML="<select name=\"gender"+n+"\" id=\"gender"+n+"\" style='width:90px' class='common_select'>"+$("gender0").innerHTML+" </select>";	
		
		c=myrow.insertCell(5);
		c.innerHTML="<input type=\"button\" name=\"addline\" id=\"addline\"	onclick=\"addlines()\" value=\" + \" /><input type=\"button\" name=\"delline\" "
			+" id=\"delline"+n+"\"	onclick=\"deleteOneLine("+n+")\" value=\" - \" />";	
	}
	
		//显示所有的学院
		function showAllCollege(){
		dWRCollegeMajorAction.getAllCollegeInfo(showAllCollegeCallback);
		
		}
		//显示所有的学院Callback
		var showAllCollegeCallback = function collegeCallback(collegeList){
					if(null == collegeList){
						return;
					}
					var collegeInfo =collegeList;
					//alert(aptValue[0].apartmentfloornum);
					var s = $("college0");
					 	DWRUtil.removeAllOptions(s);  
						s.options[0] = new Option("请选择学院",'0');
						//alert(collegeList[0].collegeinfoname)
					for ( var i = 1; i < collegeList.length+1; i++) {
						var opt = new Option(collegeList[i-1].collegeinfoname,
								collegeList[i-1].collegeinfoid);
						s.options[i] = opt;
					}
		}
		//页面onload时，让第一行显示所有的专业,同时给id==major的控件赋值为所有专业，当页面添加新行时无须再去数据库中查
		function showAllMajor(){
		dWRCollegeMajorAction. getAllMajorInfo(showAllMajorCallback);
		
		}
		//显示所有的专业Callback
		var showAllMajorCallback = function majorCallback(majorList){
					if(null == majorList){
						return;
					}
					var majorInfo =majorList;
					//alert(aptValue[0].apartmentfloornum);
					var s = $("major0");
					 	DWRUtil.removeAllOptions(s);  
						s.options[0] = new Option("请选择专业",'0');
						//alert(majorList[0].majorinfoname)
					for ( var i = 1; i < majorList.length+1; i++) {
						var opt = new Option(majorList[i-1].majorinfoname,
								majorList[i-1].majorinfoid);
						s.options[i] = opt;
					}
					
					//给display:none的${'major'}赋值
					s = $("major");
					 	DWRUtil.removeAllOptions(s);  
						s.options[0] = new Option("请选择专业",'0');
					for (  i = 1; i < majorList.length+1; i++) {
						var opt = new Option(majorList[i-1].majorinfoname,
								majorList[i-1].majorinfoid);
						s.options[i] = opt;
					}
		}
		//选择的学院变动的时候，专业联动 
		var college;
		function selectedCollegeChange(obj){
			college = obj;
			if(obj.options[obj.selectedIndex].value == '0'){
				showAllMajor();
				return;
			}
			showAllMajorByCollegeinfoid(obj.options[obj.selectedIndex].value);
			
		}
		//根据学院显示所有的专业
		function showAllMajorByCollegeinfoid(collegeinfoid){
			dWRCollegeMajorAction.getMajorInfoByCollegeId(collegeinfoid,showAllMajorByCollegeinfoidCallback);
		
		
		}
		//根据学院显示所有的专业Callback
		var showAllMajorByCollegeinfoidCallback = function  MyshowAllMajorByCollegeinfoidCallback(majorList){
				var majorInfo =majorList;
				//alert(aptValue[0].apartmentfloornum);
				var s =$('major' + college.id.substr(7));
				 	DWRUtil.removeAllOptions(s);  
					s.options[0] = new Option("请选择专业",'0');
					//alert(majorList[0].majorinfoname)
				for ( var i = 1; i < majorList.length+1; i++) {
					var opt = new Option(majorList[i-1].majorinfoname,
							majorList[i-1].majorinfoid);
					s.options[i] = opt;
				}
			
		}
				
		//选择的专业变动的时候，学院联动
		var major;
		function selectedMajorChange(obj){
			major = obj;
			if(obj.options[obj.selectedIndex].value == '0'){
				return;
			}
			//alert(obj.id.substr(5));
			//var college = $('college' + obj.id.substr(5));
			
			//obj.options[$('major'+n).selectedIndex]
			showCollegeByMajorInfoid(obj.options[obj.selectedIndex].value);
		}
		//根据专业显示学院
		function showCollegeByMajorInfoid(majorinfoid){
			dWRCollegeMajorAction.getCollegeInfoByMajorId(majorinfoid,showCollegeByMajorinfoidCallback);
		
		
		}
		//根据专业显示学院Callback  
		var showCollegeByMajorinfoidCallback = function  MyshowAllMajorByCollegeinfoidCallback(collegeList){
				var college = $('college' + major.id.substr(5));
				for(var a=0;a<college.options.length;a++){
					if(college.options[a].value == collegeList[0].collegeinfoid){
						college.options[a].selected = "selected";
						break;
					}
					
				}
			
		}
		//查询总行数，计算分页的页数，并在回调中查询显示第一页的数据
		function　searchTotalCount(sql){
			studentAction.getStudentBySQLSearchConditionsRows(sql,getStudentBySQLSearchConditionsRowsCallback);
			
		}
		//查询总行数callback
		var getStudentBySQLSearchConditionsRowsCallback = function getStudentBySQLSearchConditionsRowsCallbackFunc

(totalRecords){
			//alert(totalRecords)
			if(totalRecords == 0){
				
				$('div_selectAllPage').style.display = "none";  //隐藏'全选所有页'
				$('ok').style.display = "none";   //隐藏'查询选情'按钮
				$('div_basicInfo').style.display = 'none';
				$('dataTable').style.display = 'none'; 
				$('pageTable').style.display = 'none';
				
				
				$('deleteAllSelected').style.display = 'none';
				$('deleteAll').style.display = 'none';
				alert("查询结果为空!"); 
				return;
			}
			totalCount = totalRecords;
			$('div_selectAllPage').style.display = "";
			$('selectAllInEveryPage').checked = false;
			$('ok').style.display = "";  
			$('div_basicInfo').style.display = '';  
			$('dataTable').style.display = ''; 
			$('pageTable').style.display = '';
			
			$('deleteAllSelected').style.display = "";
			$('deleteAll').style.display = "";
			
			//回调查询学生信息
			studentAction.getStudentBySQLSearchConditionsPerPage(1,totalCount,s_sql,renderstudentcallback);
			
		}
		//判断是否选择了查询条件
		function isChooseConditions(){
			var isNone = 1;  //判断是否任何查询条件都未选,默认为是
			for(var n=0;n<=max;n++)
 			{
	 			if($("tr"+n).style.display != "none")
	 			{
					if($("college"+n).options[$('college'+n).selectedIndex].text == "请选择学院" && $("grade"+n).options[$('grade'+n).selectedIndex].text == "请选择年级" &&$("gender"+n).options[$('gender'+n).selectedIndex].text == "请选择性别"){
					}
					else{
						isNone = 0;
						break;
					}
				}
			}
			if(isNone == 1){
				return false;
			}else{
				return true;
			}
		
		}
		
		//高级查询学生页面显示,changed by zhengxu
		function renderConditionStudentSearchPage(){
			studentidList.length = 0;
			
			if(!isChooseConditions()){    //判断是否选择了某些查询条件
				alert("请选择查询条件!");
				return;
			}
			
			s_sql =whenSub();
			searchTotalCount(s_sql);
		}
		//高级查询callback
		var renderstudentcallback = function setStudentSearchPage(stulist){
			//studentList = stulist;
			if(stulist==null){
				alert("查询到的学生结果为空！");
				return;
			}
			if($('dataTable').style.visibility == 'hidden'){
				$('dataTable').style.visibility = 'visible';
			}
			if($('pageTable').style.visibility == 'hidden'){
				$('pageTable').style.visibility = 'visible';
			}
			/**
			*filter，这段不好理解，作用是拷贝了一份dlist，并与服务器的dlist同步id
			*/
			DWRUtil.removeAllRows('ttb', { filter:function(tr) {
			      return (tr.id != "pattern");
				    }});
			      ////===============fengexian====
			 var stud, id;
			//alert(stulist[0][0]);
			 for (var i =0; i < stulist.length ; i++) {
				 stud = stulist[i];
			      id = stud[0];
			    dwr.util.cloneNode("pattern", { idSuffix:id });
			     dwr.util.setValue("tableid" + id, stud[0]);
			     dwr.util.setValue("tableno" + id, stud[1]);
			     dwr.util.setValue("tablename" + id, stud[2]);
			      dwr.util.setValue("tablesex" + id, stud[3]);
			       if('object' == typeof(stud[4])){
			      		 dwr.util.setValue("tableclass" + id, "");
			      }else{
			     		  dwr.util.setValue("tableclass" + id, stud[4]);
			      }
			      
			      if('object' == typeof(stud[5])){
			      		 dwr.util.setValue("tablecollegename" + id, "");
			      }else{
			     		 dwr.util.setValue("tablecollegename" + id, stud[5]);
			      }
			      
			      if('object' == typeof(stud[6])){
			      		 dwr.util.setValue("tablemajorname" + id, "");
			      }else{
			     		 dwr.util.setValue("tablemajorname" + id, stud[6]);
			      }
			      
			      if('object' == typeof(stud[7])){
			      		 dwr.util.setValue("tabledormitory" + id, "");
			      		 
			      }else{
			     		 dwr.util.setValue("tabledormitory" + id, stud[7]);
			      }
			      
			      dwr.util.setValue("cbx" + id, stud[0]);
			   	 $("pattern" + id).style.display= "";
	             stuCache[id] = stulist;
			   }
				setPageInfo();
				tbCSS();
			}
			
			
			
		function setPageInfo(){
        $('pageTd').innerHTML = '';
        studentAction.getPage({     
            callback:function(data){
                page = data;
                if(page.totalPage != 0){
                    var pageSpan = document.createElement('span');
                    pageSpan.innerHTML = '共 '+totalCount+' 条 '+'   第 '+page.currentPage+' 页    共'+page.totalPage+' 页 ';
                    $('pageTd').appendChild(pageSpan);
                    var aFirst = document.createElement('a');
                    aFirst.setAttribute('href','javascript:getFirstData()');
                    aFirst.innerHTML = '首页';
                    $('pageTd').appendChild(aFirst);
                    var aPrevious = document.createElement('a');
                    aPrevious.setAttribute('href','javascript:getPreviousData()');
                    aPrevious.innerHTML = '上一页 ';
                    $('pageTd').appendChild(aPrevious);
                    var aNext = document.createElement('a');
                    aNext.setAttribute('href','javascript:getNextData()');
                    aNext.innerHTML = '下一页 ';
                    $('pageTd').appendChild(aNext);
                    var aLast = document.createElement('a');
                    aLast.setAttribute('href','javascript:getLastData()');
                    aLast.innerHTML = '尾页';
                    $('pageTd').appendChild(aLast);    
                }               
            }
        });
        $('loading').style.display = 'none';
        judgeCheckboxInNewPage();
		$('flagcbx').checked = false;
		setRowColor($('dataTable'),'row_odd','row_even');
    }    

			
			
		function getFirstData(){
			page.currentPage = 1;
			getDataPerPage();
		}
		
	    function getPreviousData(){
        if(page.currentPage>1){
            page.currentPage--;
        }
        getDataPerPage();
  	  }
    
    	function getNextData(){
        if(page.currentPage<page.totalPage){
            page.currentPage++;
        }
        getDataPerPage();
   	 }
		
		function getLastData(){
			page.currentPage = page.totalPage;
			getDataPerPage();
		}
		
		
		function getDataPerPage(){
			$('loading').style.display = 'block';
			studentAction.getStudentBySQLSearchConditionsPerPage(page.currentPage,totalCount, s_sql,renderstudentcallback);
		}	



		function editClicked(eleid) {
			  //得到的eleid为"edit{id}"，如 "edit42".,经过substring后为42,person的id
			  alert(eleid.substring(4));
		}
		

		//全选所有的checkbox
		function selectAllcbx(){
			var   a=document.getElementsByTagName("input");  
			//alert($('cbx').checked);
        	for(var i=0;i<a.length;i++){  
              if(a[i].type=='checkbox'){
              	  if(a[i].id == "cbx" || a[i].id == "flagcbx"|| a[i].id == "selectAllInEveryPage"){
              	  	continue;
              	  }
              	  a[i].checked = true ;
              	  if(studentidList.length == 0){
              	  	studentidList[0] = a[i].id.substr(3);
              	  }
              	  for(var b=0;b<studentidList.length;b++){
                  	if(a[i].id.substr(3) == studentidList[b])
                  		break;
                  	else if(b == studentidList.length-1){
                  		studentidList[studentidList.length] = a[i].id.substr(3);	
                  	}
                  }
              }
            }  
            //alert(studentidList.length+"#"+studentidList);
        }  
        //均不选所有的checkbox
		function selectNonecbx(){
			var   a=document.getElementsByTagName("input");  
        	for(var i=0;i<a.length;i++){  
              if(a[i].type=='checkbox'){  
              	  if(a[i].id == "cbx"){
              	  	continue;
              	  }
                  a[i].checked = false ;
                  for(var b=0;b<studentidList.length;b++){
                  	if(a[i].id.substr(3) == studentidList[b]){
                  		studentidList.splice(b,1);
                  		break;
                  	}
                  	else continue;
                  }
              }  
            }  
            //alert(studentidList.length)
        } 
        //被选中的所有studentid
       	var studentidList = new   Array();
       	function updateStudentidList(obj){
        	//alert(obj.checked)
        	$('selectAllInEveryPage').checked = false;
        	if(obj.checked==true){
        		studentidList[studentidList.length] = obj.id.substr(3);	
        		//alert(studentidList+"*"+studentidList.length)
        	}
        	if(obj.checked==false){
        		for(var i=0;i<studentidList.length;i++){
        			if(obj.id.substr(3) == studentidList[i]){
        				studentidList.splice(i,1);
        				//alert(studentidList);
        			}
        		}
        	}
        }
        function whenLoad(){
       		showAllCollege();
       		showAllMajor();
        }
        function beSure(){
        	alert("已勾选学生人数:"+studentidList.length+"\n已勾选所有学生id:   "+studentidList);
        }
        //dwr分页中，当进入到新的页面时判断当前页的checkbox是否曾经被选中，并存入了studentList中
		function judgeCheckboxInNewPage(){
			var a=document.getElementsByTagName("input");  
        	for(var i=0;i<a.length;i++){  
               if(a[i].type=='checkbox' && a[i].id != 'selectAllInEveryPage'){  
              	  if(studentidList.length == 0){
              	  	 a[i].checked = false;
              	  }
                  for(var b=0;b<studentidList.length;b++){
                  	if(a[i].id.substr(3) == studentidList[b]){
                  		a[i].checked = true;
                  		break;
                  	}
                  	if(b == studentidList.length - 1){
                  		a[i].checked = false;
                  	}
                  	else {
                  		continue;
                  	}
                  }
              }
            }
		}
	
    
       //当作为全选标志的checkbox被选中的时候，所有学生被选中，反之则全不选中
       function checkForSelectAll(){
       		if($('flagcbx').checked == true){
       			selectAllcbx();
       		}else{
       			selectNonecbx();
       		}
       } 
       //全选所有查询到的学生
       function selectAllSearched(){
       		if($('selectAllInEveryPage').checked == true){
       			studentAction.getStudentBySQL(s_sql,getStudentBySQLCallback);
       		}else {
       			studentidList.length = 0;
       			selectNonecbx();
       		}
       
       }
       //全选所有查询到的学生回调函数
       var getStudentBySQLCallback = function getStudentBySQLCallbackFunc(sList){
       		studentidList.length = 0;
       		for(var a = 0;a<sList.length;a++){
       			studentidList[studentidList.length] = sList[a];
       		}
       		selectAllcbx();
       		//alert(studentidList.length+"**"+studentidList[0])
       }
       //单击查询到的学生的某一行时，在页面的下方显示学生的基本信息
       function getStudentInfoByNo(obj){
       		var id = obj.id.substr(7);
       		//alert("id:" + id + "$$$tableno:" + $('tableno' + id).innerHTML)
       		$('student_info').value = $('tableno' + id).innerHTML;
       		stu_BasicInfo();
       }
       
       
       	function deleteAllSelectedStudents(){
       		if(studentidList == null){
       			alert("您尚未选中任何学生");
       			return;
       		}
       		if(!confirm("确认退宿已勾选的学生?")){
       			return;
       		}
			//alert(studentidList);
			var sql = " where student.studentid in (" + studentidList + ")";
			//alert(sql);
			studentLodgeMgrAction.checkOutBatchStudent(sql,checkOutBatchStudentCallback);
		}

		function deleteAllStudents(){
			if(!confirm("确认退宿满足查询条件的所有学生(包括已勾选和未勾选的)?")){
	       			return;
	       	}
		    var sql = s_sql.substr(21);
		    //alert(sql);
		   studentLodgeMgrAction.checkOutBatchStudent(sql,checkOutBatchStudentCallback);
		}
		var checkOutBatchStudentCallback = function checkOutBatchStudentCallbackFunc(effectNum){
			alert("退宿"+effectNum+"条记录成功!");
		}
	</script>

	</head>

	<body onload="whenLoad();">
		<div id="page_container" style="width:99%">
		<%@include file="checkoutbanner.jsp"%>
		<h2>批量退宿</h2>
			<div 
				style="text-align: -moz-center !important; text-align: center;">
				<form action="student/exportselectedstudentstoexcel.action"
					method="post" id="formForExportToExcel">
					<br />
					<select class="common_select" name="major" id="major" style="display: none">
					</select>
					<table class="table_common" border="1" id="searchTable" style="width: 100%;">
						<tr id="tr0" >
							<td >
								<select class="common_select"  name="flag0" id="flag0" style="display: none">
									<option value="or" selected="selected">
									</option>
								</select>
							</td>
							<td >
								<select class="common_select"  name="college0" id="college0" style="width: 160px"
									onchange="selectedCollegeChange(this)">
								</select>
							</td>
							<td >
								<select  class="common_select" name="majorflag0" id="majorflag0" style="width: 38px">
									<option value="and" selected="selected">
									</option>
									<option value="not">
										非
									</option>
								</select><select class="common_select"  name="major0" id="major0" style="width: 148px;"
									onchange="selectedMajorChange(this)">
								</select>
							</td>
							<td >
								<select class="common_select"  name="gradeflag0" id="gradeflag0" style="width: 50px">
									<option value="and" selected="selected">
									</option>
									<option value="bigger">
										迟于
									</option>
									<option value="smaller">
										早于
									</option>
									<option value="not">
										非
									</option>
								</select><select class="common_select"  name="grade0" id="grade0" style="width: 90px;">
									<option value="请选择年级" selected="selected">
										请选择年级
									</option>
									<option value="2003">
										2003级
									</option>
									<option value="2004">
										2004级
									</option>
									<option value="2005">
										2005级
									</option>
									<option value="2006">
										2006级
									</option>

									<option value="2007">
										2007级
									</option>
									<option value="2008">
										2008级
									</option>
									<option value="2009">
										2009级
									</option>
									<option value="2010">
										2010级
									</option>
								</select>
							</td>
							<td >
								<select class="common_select"  name="gender0" id="gender0" style="width: 90px">
									<option value="请选择性别" selected="selected">
										请选择性别
									</option>
									<option value="男">
										男
									</option>
									<option value="女">
										女
									</option>
								</select>
							</td>
							<td><input type="button" name="addline" id="addline"
									onclick="addlines()" value=" + " />
							</td>
						</tr>
					</table>
					<br />
					
						 <span style="text-align: left; ">
							<input class="common_button" type="button" name="ok" id="ok" value="查看选情"  style="display:none;visibility: hidden;"
								onclick="beSure()" />
						</span>
					    <span style="text-align: right;width: 80%;">
							<input  class="common_button" type="button" name="submit" id="submit" value="提交查询" 
								onclick="renderConditionStudentSearchPage()" />
						</span>
						<p>
						<!--  
						<input type="button" name="selectAll" id="selectAll"
							value="选择当页全部学生" onclick="selectAllcbx()" />
						<input type="button" name="selectNone" id="selectNone"
							value="反选当页全部学生" onclick="selectNonecbx()" />
						<p />
						-->
						
						<span id="div_selectAllPage" style="display:none">
							<input type="checkbox" id="flagcbx" onclick="checkForSelectAll()">
							选择当前页	
							<input type="checkbox" id="selectAllInEveryPage" onclick="selectAllSearched()" />
							全选所有页
						</span>
						<input class="long_button"  type="button" name="getAllSelected" id="deleteAllSelected" style="display:none"
							value="退宿选中的" onclick="deleteAllSelectedStudents()" />
						<input class="long_button"  type="button" name="getAll" id="deleteAll" style="display:none"
							value="退宿全部" onclick="deleteAllStudents()" />
					
					
				</form>
				<table class="sortable scrolltable table_list_style table_common" id="dataTable"
					style="visibility: hidden" rowclass="row_odd,row_even">
					<thead>
						<tr>
							<th class="sorttable_nosort" width="15px">

							</th>
							<th width="60px">
								学号
							</th>
							<th width="45px">
								姓名
							</th>
							<th width="35px">
								性别
							</th>
							<th width="130px">
								学院
							</th>
							<th width="120px">
								专业
							</th>
							<th width="80px">
								班级
							</th>
							<th width="120px">
								宿舍
							</th>
						</tr>
					</thead>
					<tbody id="ttb">
						<tr id="pattern" style="display: none"
							onclick="getStudentInfoByNo(this)">
							<td>
								<input type="checkbox" id="cbx" name="cbx"
									onclick="updateStudentidList(this)" />
							</td>
							<td>
								<span id="tableno">id</span>
							</td>
							<td>
								<span id="tablename">name</span>
							</td>
							<td>
								<span id="tablesex">sex</span>
							</td>
							<td>
								<span id="tablecollegename">collegename</span>
							</td>
							<td>
								<span id="tablemajorname">majorname</span>
							</td>
							<td>
								<span id="tableclass">class</span>
							</td>
							<td>
								<span id="tabledormitory">dormitory</span>
							</td>
							<!--  
							<td><input id="edit" type="button" value="编辑" style="display: none" onclick="editClicked(this.id)" /></td>
							-->
						</tr>
					</tbody>
				</table>
				<table id="pageTable" align="center"
					style="visibility: hidden; font: 12px;" class="navigator">
					<tr>
						<td id="pageTd">
						</td>
					</tr>
				</table>
				<div id="loading"
					style="display: none; text-align: center; color: red; font: 13px;">
					Loading...
				</div>
			</div>
			<!-- <div id="hori_line"></div> -->
			<div style="display:none;" id="div_basicInfo">
				<hr size="1" width="600"/>
				<jsp:include page="/student/basicstudentinfo.jsp"></jsp:include>
			</div>
		</div>
	</body>
</html>
